package com.iplant.pdm.service.po.bop.step;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.pdm.service.basicenum.fpc.FPCQualificationType;

import java.io.Serializable;
import java.util.Calendar;

/**
 * 人员资质
 *
 * @author YouWang·Peng
 * 2023-7-23 18:15:50
 */
@DBBasePO(TableName = "fpc_personqualification", CheckName = {"PersonID,QualificationID"},
        Schemas =
                DBSchemas.PDM)
public class FPCPersonQualification extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;//序列号

    @DBCondition
    @DBField
    public int PersonID = 0;//人员ID
    @DBJoin(name = "Name", tableName = "mbs_user", tableAsName = "user1", Schemas = DBSchemas.Basic,
            MainTableField = "PersonID")
    public String PersonName = "";//人员名称

    @DBCondition
    @DBField
    public int QualificationID = 0;//资质ID
    @DBJoin(name = "Name", tableName = "fpc_qualification", tableAsName = "qualification1", Schemas = DBSchemas.PDM,
            MainTableField = "QualificationID")
    public String QualificationName = "";//资质名称
    @DBJoin(name = "Code", tableName = "fpc_qualification", tableAsName = "qualification1", Schemas = DBSchemas.PDM,
            MainTableField = "QualificationID")
    public String QualificationCode = "";//资质编码
    @DBJoin(name = "QualificationType", tableName = "fpc_qualification", tableAsName = "qualification1", Schemas =
            DBSchemas.PDM,
            MainTableField = "QualificationID")
    public int QualificationType = 0;//资质类型ID
    public String QualificationTypeText = "";//资质类型文本

    @DBField
    public Calendar EffectiveTime = Calendar.getInstance();//生效时间
    @DBField
    public Calendar ExpirationTime = Calendar.getInstance();//失效时间

    @DBField
    public String Attachments = "";//附件(可多选，逗号隔开即可)

    @DBCondition
    @DBField
    public int Status = 0;//状态(预留，暂未定义)
    public String StatusText = "";//状态文本(预留，暂未定义)

    public FPCPersonQualification() {
    }

    @JsonProperty("PersonID")
    public int getPersonID() {
        return PersonID;
    }

    public void setPersonID(int personID) {
        PersonID = personID;
    }

    @JsonProperty("PersonName")
    public String getPersonName() {
        return PersonName;
    }

    public void setPersonName(String personName) {
        PersonName = personName;
    }

    @JsonProperty("QualificationID")
    public int getQualificationID() {
        return QualificationID;
    }

    public void setQualificationID(int qualificationID) {
        QualificationID = qualificationID;
    }

    @JsonProperty("QualificationName")
    public String getQualificationName() {
        return QualificationName;
    }

    public void setQualificationName(String qualificationName) {
        QualificationName = qualificationName;
    }

    @JsonProperty("QualificationCode")
    public String getQualificationCode() {
        return QualificationCode;
    }

    public void setQualificationCode(String qualificationCode) {
        QualificationCode = qualificationCode;
    }

    @JsonProperty("QualificationType")
    public int getQualificationType() {
        return QualificationType;
    }

    public void setQualificationType(int qualificationType) {
        QualificationType = qualificationType;
    }

    @JsonProperty("QualificationTypeText")
    public String getQualificationTypeText() {
        QualificationTypeText = FPCQualificationType.getEnumType(QualificationType).getLabel();
        return QualificationTypeText;
    }

    public void setQualificationTypeText(String qualificationTypeText) {
        QualificationTypeText = qualificationTypeText;
    }

    @JsonProperty("EffectiveTime")
    public Calendar getEffectiveTime() {
        return EffectiveTime;
    }

    public void setEffectiveTime(Calendar effectiveTime) {
        EffectiveTime = effectiveTime;
    }

    @JsonProperty("ExpirationTime")
    public Calendar getExpirationTime() {
        return ExpirationTime;
    }

    public void setExpirationTime(Calendar expirationTime) {
        ExpirationTime = expirationTime;
    }

    @JsonProperty("Attachments")
    public String getAttachments() {
        return Attachments;
    }

    public void setAttachments(String attachments) {
        Attachments = attachments;
    }

    @JsonProperty("Status")
    public int getStatus() {
        return Status;
    }

    public void setStatus(int status) {
        Status = status;
    }

    @JsonProperty("StatusText")
    public String getStatusText() {
        return StatusText;
    }

    public void setStatusText(String statusText) {
        StatusText = statusText;
    }
}
